import axios from 'axios'
import { dbIp } from './config.js'
import { get_cache } from '@/util/cache.js'
var ip = dbIp

export function addTopic (param){
    return axios({
        method: "post",
        url: ip+"/topic/add",
        data: {
            name: param.name,
            type: param.type
        }
    });
}

export function getTopicList (param){
    return axios({
        method: "get",
        url: ip+"/topic/getTopicList",
        params: {
            user: get_cache("token")
        }
    });
}